-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tls: refactoring SNI ctx usage for libressl support #1136
Conversation
@cspiel1 can you review and test with your SNI setup? |
Yes, I'll try to do so. It will take some time to arrange the setup. Maybe I have to ask also our QA team. |
By means of debugging I could verify that the correct certificate was selected. But then I had no luck with the cert verification on the callee (TLS server side), also in main branch. The next two days will be difficult to work on this. |
I am coming closer with the test setup. Will have a result soon. |
I have some troubles:
|
Not sure why, but verify client is always enabled for SNI here: Line 158 in 9f90b79
It works for test, does it also not work with main? |
Beside of these issues, that also occur in
With another cert chain, and a second account it works also. But as mentioned above, the The code looks good. I suggest to merge this. |
Ah, ok. Not sure if this is wanted.
Yes. This should be analysed further. |
@sreimers I have noticed that this PR changed the behavior quite a bit. Was that on purpose? E.g. if the peer does not add the |
There are different options to choose a certificate. E.g. Certificates configured in accounts. Or globally in config file. Thus a missing |
I think this is a bug, can you try: diff --git a/src/tls/openssl/sni.c b/src/tls/openssl/sni.c
index 8298e40f..8be0e7f7 100644
--- a/src/tls/openssl/sni.c
+++ b/src/tls/openssl/sni.c
@@ -166,10 +166,8 @@ static int ssl_servername_handler(SSL *ssl, int *al, void *arg)
const char *sni;
sni = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
- if (!str_isset(sni)) {
- *al = SSL_AD_UNRECOGNIZED_NAME;
- return SSL_TLSEXT_ERR_ALERT_FATAL;
- }
+ if (!str_isset(sni))
+ return SSL_TLSEXT_ERR_OK;
/* find and apply matching certificate */
uc = tls_cert_for_sni(tls, sni); |
Replaces unsupported (by LibreSSL)
SSL_certs_clear
with recommendedSSL_set_SSL_CTX()
:https://www.openssl.org/docs/man3.3/man3/SSL_CTX_set_tlsext_servername_callback.html